﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CompilerForC.SyntaxAnalysis
{
    /// <summary>
    /// Describes syntax error that occurred during parsing of the token stream.
    /// </summary>
    /// <seealso cref="Parser"/>
    public struct SyntaxError
    {
        #region Private Fields

        /// <summary>
        /// One-based line number of the error. Zero if line number could not
        /// be determined.
        /// </summary>
        public int Line;
        /// <summary>
        /// Description of the error.
        /// </summary>
        public string Description;

        #endregion Private Fields

        #region Constructor

        /// <summary>
        /// Constructs and initializes SyntaxError.
        /// </summary>
        /// <param name="line">Line number of the error. Specify zero if line
        /// number could not be determined.</param>
        /// <param name="description">Description of the error.</param>
        public SyntaxError(int line, string description)
        {
            Line = line;
            Description = description;
        }

        #endregion Constructor
    }
}
